package singleton;

/**
 * @Author: 80305082
 * @Date: 2021/3/22
 * @Description: 双重校验
 */
public class Singleton04 {

    private static volatile Singleton04 instance;

    private Singleton04() {

    }

    public static Singleton04 getInstance() {
        if (instance == null) {
            synchronized (Singleton04.class) {
                if (instance == null) {
                    instance = new Singleton04();
                }
            }
        }
        return instance;
    }

}
